package mysql

import "gorm.io/gorm"

type Coupon struct {
	gorm.Model
	UserId        int     `gorm:"type:int(10);not null;comment:'用户id'"`
	CouponName    string  `gorm:"type:varchar(255);not null;comment:'优惠卷名称'"`
	DiscountPrice float64 `gorm:"type:double(10,2);not null;comment:'优惠价格'"`
	Condition     float64 `gorm:"type:double(10,2);not null;comment:'条件'"`
}

func CouponCreate(coupon *Coupon) error {
	return DB.Debug().Create(&coupon).Error
}
